/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3EA4497B-8219-44BB-B16E-F47C9CCB0EED"}
 * @SuppressWarnings(deprecated)
 */
function alta(event) {
	databaseManager.setAutoSave(false)
	currentcontroller.newRecord()
	
	elements.btn_confirmar.visible = true
	elements.btn_cancelar.visible = true
	
	currentcontroller.readOnly = false
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6D14B391-392C-4AFF-8F18-091AC04238F2"}
 * @SuppressWarnings(deprecated)
 */
function baja(event) {
	currentcontroller.deleteRecord()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A8896E69-BEC2-4EBA-A0BD-7CE99D3A2C1E"}
 * @SuppressWarnings(deprecated)
 */
function siguiente(event) {
	var actual = currentcontroller.getSelectedIndex()
	currentcontroller.setSelectedIndex(actual +1)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"578542DA-0450-4675-B3E5-9269FFC8AFD7"}
 * @SuppressWarnings(deprecated)
 */
function anterior(event) {
	var actual = currentcontroller.getSelectedIndex()
	currentcontroller.setSelectedIndex(actual -1)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B4C0E239-132D-42DD-879D-6C136521C93B"}
 * @SuppressWarnings(deprecated)
 */
function confirmar(event) {
	
	databaseManager.saveData()
	databaseManager.setAutoSave(true)
	elements.btn_confirmar.visible = false
	elements.btn_cancelar.visible = false
	
	currentcontroller.readOnly = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6D34D562-6D0B-4E92-9B88-C78C47FEE79F"}
 * @SuppressWarnings(deprecated)
 */
function cancelar(event) {
	
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	elements.btn_confirmar.visible = false
	elements.btn_cancelar.visible = false
	
	currentcontroller.readOnly = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"FFC9F11C-D830-4AEA-86B2-7F75E5BBCC31"}
 * @SuppressWarnings(deprecated)
 */
function modificar(event) {
	databaseManager.setAutoSave(false)
	
	elements.btn_confirmar.visible = true
	elements.btn_cancelar.visible = true
	
	currentcontroller.readOnly = false
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B89E5F8F-03BF-4754-B6BA-800E3F7DA9E4"}
 */
function iraHoteles(event) {
//	var ventana = application.createWindow('V_HOTELES',JSWindow.MODAL_DIALOG)
	//forms.hoteles_tbl.controller.show(ventana)
	forms.hoteles_dtl.controller.show()
	elements.grp_btnes.visible = true
	//var boton = globals.DIALOGS.showErrorDialog('Error','Ocurrio un error','Si','No')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6FA2C3F2-4C26-49F2-93A9-DEF48C248AD6"}
 */
function reservas(event) {
	forms.carga_reserva.controller.show()
	
	elements.grp_btnes.visible = false
	forms.carga_reserva_htl.elements.ConsultaRooming.enabled = false
	forms.carga_reserva_htl.elements.Rooming.enabled = false
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5A47F4DA-8585-47C6-9A1D-874A8C96A2D6"}
 */
function IraTraslados(event) {
	forms.traslados_dtl.controller.show()
	elements.grp_btnes.visible = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B8A516EF-2EBA-46ED-9D5E-ACE5E5FFF403"}
 */
function IraExcursiones(event) {
	forms.excursiones_dtl.controller.show()
	elements.grp_btnes.visible = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"AA0BEEB2-4EF3-4816-B5E6-AA99B1621756"}
 */
function iraModifReserva(event) {
	forms.reserva_tbl.controller.show()
	elements.grp_btnes.visible = false
	forms.carga_reserva_htl.elements.ConsultaRooming.enabled = true
	forms.carga_reserva_htl.elements.Rooming.enabled = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"0B0F5206-9C5E-418E-83F6-1B15DB305ADE"}
 */
function IrATipoHab(event) {
	forms.hotelhab_dtl.controller.show()
	elements.grp_btnes.visible = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"028AC0B3-40B5-4E5B-8313-1F6110171E89"}
 */
function IrATipoTra(event) {
	forms.trasladodh_dtl.controller.show()
	elements.grp_btnes.visible = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"450CD67E-7102-4E10-BC0E-5EB5626AB16C"}
 */
function IrAReservaConsulta(event) {
	forms.reserva_tbl_2.controller.show()
	elements.grp_btnes.visible = true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"521A5325-4B9A-48C9-9D02-938D47F447DE"}
 */
function IrATipoExc(event) {
	forms.excursiondh_dtl.controller.show()
	elements.grp_btnes.visible = true
}
